/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Keith Augustsson
 */
@Entity
@Table(name = "otherflights")
@NamedQueries({@NamedQuery(name = "Otherflights.findAll", query = "SELECT o FROM Otherflights o"), @NamedQuery(name = "Otherflights.findByAirline", query = "SELECT o FROM Otherflights o WHERE o.otherflightsPK.airline = :airline"), @NamedQuery(name = "Otherflights.findByFlight", query = "SELECT o FROM Otherflights o WHERE o.otherflightsPK.flight = :flight")})
public class Otherflights implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected OtherflightsPK otherflightsPK;

    public Otherflights() {
    }

    public Otherflights(OtherflightsPK otherflightsPK) {
        this.otherflightsPK = otherflightsPK;
    }

    public Otherflights(String airline, String flight) {
        this.otherflightsPK = new OtherflightsPK(airline, flight);
    }

    public OtherflightsPK getOtherflightsPK() {
        return otherflightsPK;
    }

    public void setOtherflightsPK(OtherflightsPK otherflightsPK) {
        this.otherflightsPK = otherflightsPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (otherflightsPK != null ? otherflightsPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Otherflights)) {
            return false;
        }
        Otherflights other = (Otherflights) object;
        if ((this.otherflightsPK == null && other.otherflightsPK != null) || (this.otherflightsPK != null && !this.otherflightsPK.equals(other.otherflightsPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Otherflights[otherflightsPK=" + otherflightsPK + "]";
    }

}
